import {commonParams} from '@/api/config'
import axios from 'axios'

// 歌词接口
export function getTopList () {
  const url = '/api/getTopList'
  const data = Object.assign({}, commonParams, {
    uin: 0,
    needNewCode: 1,
    platform: 'h5',
    format: 'json'
  })
  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}

// 歌曲排行榜歌曲详情列表
export function getTopMusic (topid) {
  const url = '/api/getTopMusic'
  const data = Object.assign({}, commonParams, {
    topid,
    format: 'json',
    needNewCode: 1,
    uin: 0,
    tpl: 3,
    page: 'detail',
    type: 'top',
    platform: 'h5'
  })
  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res)
  })
}
